package com.wfms.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2018/1/3.
 */
@RestController
@RequestMapping("/out")
public class OutputController {


    @Autowired
    @Qualifier("output")
    MessageChannel messageChannel;

    @GetMapping("/test")
    public String test(){
        System.out.println("message send Success!");
        messageChannel.send(MessageBuilder.withPayload("hellow").build());
        return "1";
    }
}
